/*
 * Misc.h
 *
 * Copyright (c) 2009-2011 [BRN] aka. SWW13.
 *
 * This file is part of [BRN]Lib.
 *
 * [BRN]Lib is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * [BRN]Lib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with [BRN]Lib.  If not, see <http ://www.gnu.org/licenses/>.
 */

#pragma once
#include <windows.h>
#include <ctime>

namespace BRNlib
{
	namespace Tools
	{
		class Misc
		{
		public:
			/// Compare a Mask with Data
			static bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask);

			/// Search a Pattern
			/// From dwAddress till dwLen
			/// Returns the position of the found + codeOffset, if extract is true it will read the adress from found
			static DWORD FindPattern(DWORD dwAddress, DWORD dwLen, BYTE *bMask, char * szMask, int codeOffset = 0, BOOL extract = false);

			///...
			static DWORD QuickChecksum(DWORD *pData, int size);

			/// Gets the Screen Size with GetSystemMetrics
			static POINT GetScreenSize();

			/// Gets the Screen Center with GetSystemMetrics
			static POINT GetScreenCenter();
			
			/// Returns a pointer to a static array with the date at last call
			static char *Date();
			
			/// Returns a pointer to a static array with the time at last call
			static char *Time();

			/// Returns the Path of a dll to a static array with the path at last call
			static char *GetDllPath(HINSTANCE hInst);

			///Returns the Path of a file in a directory to a static array with the path at last call
			static char *GetDirectoryFile(char* Directory, char* FileName);

			static RECT GetRect(POINT Pos, POINT Size);
		};
	};
}